using System;
using System.Collections.Generic;
using System.Text;

namespace Entities
{
    public class CartItemInfo
    {

        // Internal member variables
        private int quantity = 1;
        private string itemId;
        private string name;        
        private decimal price;
        private string descriptionBrief;
        private int unitInStock;
        private string picture;
        private int categoryId;
        private int productId;

        /// <summary>
        /// Default constructor
        /// </summary>
        public CartItemInfo() { }

        /// <summary>
        /// Constructor with specified initial values
        /// </summary>
        /// <param name="itemId">Id of item to add to cart</param></param>
        /// <param name="name">Name of item</param>
        /// <param name="qty">Quantity to purchase</param>
        /// <param name="price">Price of item</param>
        /// /// <param name="type">Number of Items in stock</param>
        /// <param name="type">Item's Description in biref</param>
        /// <param name="type">Picture of item</param>
        /// <param name="categoryId">Parent category id</param>
        /// <param name="productId">Parent product id</param>
        public CartItemInfo(string itemId, string name, int qty, decimal price, string descriptionBrief, int unitInStock, string picture, int categoryId, int productId)
        {
            this.itemId = itemId;
            this.name = name;
            this.quantity = qty;
            this.price = price;
            this.unitInStock = unitInStock;
            this.descriptionBrief = descriptionBrief;
            this.picture = picture;
            this.categoryId = categoryId;
            this.productId = productId;
        }

        // Properties
        public int Quantity 
        {
            get { return quantity; }
            set { quantity = value; }
        }

        public decimal Subtotal 
        {
            get { return (decimal)(this.quantity * this.price); }
        }

        public string ItemId 
        {
            get { return itemId; }
        }

        public string Name 
        {
            get { return name; }
        }

        public string DescriptionBrief 
        {
            get 
            {
                return descriptionBrief;
            }
        }

        public int UnitInStock
        {
            get { return unitInStock; }
            set { unitInStock = value; }
        }

        public string Picture
        {
            get { return picture; }
        }

        public decimal Price 
        {
            get { return price; }
        }

        public int CategoryId 
        {
            get 
            {
                return categoryId;
            }
        }
        public int ProductId 
        {
            get 
            {
                return productId;
            }
        }
    }
}
